package com.lidx.back.statistics.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lidx.back.statistics.dao.IMaterialDao;
import com.lidx.back.statistics.dao.IMaterialRecordDao;
import com.lidx.back.statistics.entity.MaterialRecord;
import com.lidx.back.statistics.service.IMaterialRecordService;
@Service
public class MaterialRecordServiceImpl implements IMaterialRecordService {

	@Autowired
	private IMaterialRecordDao materialRecordDao;
	
	public void saveRecord(MaterialRecord record) {
		record.setRecordTime(new Date());
		materialRecordDao.insertRecord(record);

	}

	public List<MaterialRecord> getMaterialRecords() {
		return materialRecordDao.getRecords();
	}

	public List<Object[]> getRecordsWithParams(String action, String versionType,
			String from, String to) {
		return materialRecordDao.getRecordsWithParams(action, versionType, from, to);
	}

	public List<Object[]> getRecordsWithChannel(String action,
			String versionType, String from, String to) {
		return materialRecordDao.getRecordsWithChannel(action, versionType, from, to);
	}

}
